package ophiux.wechatpay.sdk.common.net;

import ophiux.wechatpay.sdk.OphiuxWeChatPaySDKException;
import ophiux.wechatpay.sdk.common.utils.HttpUtil;

public class HttpsApiRequest implements INetApiRequest{

	@Override
	public String request(String serviceURL, String methodName, String StrParam)
			throws OphiuxWeChatPaySDKException {
		return request(serviceURL, methodName, StrParam,30*1000);
	}

	@Override
	public String request(String serviceURL, String methodName,
			String StrParam, int timeOut) throws OphiuxWeChatPaySDKException {
		String response = null;
		try {
			response = HttpUtil.httpsRequest(serviceURL, methodName, StrParam, timeOut);
		} catch (Exception e) {
			throw new OphiuxWeChatPaySDKException(e);
		}
		return response;
	}

	@Override
	public String getPostMethodSSL(String serviceURL, String methodName,
			String StrParam, String sslFilePath, String mch_id) throws OphiuxWeChatPaySDKException{
		String response = null;
		try {
			response = HttpUtil.getPostMethodSSL(serviceURL, methodName, StrParam, sslFilePath,mch_id);
		} catch (Exception e) {
			throw new OphiuxWeChatPaySDKException(e);
		}
		return response;
	}

}
